/**
 *      Copyright (c) 2006-05-01 Yazy<yazy@mail.csdn.net>
 *      
 */

#ifndef __I_hpp____YAZY__
#define __I_hpp____YAZY__ 1
#       if defined(YISC_ENABLE_TEST_MACROS)
#       include <iostream>
namespace yisc { namespace unit_test {

  void default_handler_I(const char* exprn, const char* filename, int line);
  void default_handler_L(const char* msg, const char* exprn, 
                         const char* filename, int line);
  void warning_I(const char* exprn, const char* filename, int line);
  
}//namespace unit_test
}//namespace yisc

                /**
                 * I    Invarant:       insuring and stops on failure
                 * T    Test:           testing and reports on failure
                 * L    Log:            prints some messages
                 * D    Debug:          to enable closibility of the
                 *                      surrounding code.
                 */
#               define Ih yisc::unit_test::default_handler_I
#               define Iw yisc::unit_test::warning_I
#               define Lh yisc::unit_test::default_handler_L
#               define I(e) if (!(e)) Ih("I("#e")", __FILE__, __LINE__)
#               define T(e) if (!(e)) Iw("I("#e")", __FILE__, __LINE__)
#               define L(m) Lh(m, "", __FILE__, __LINE__)
#               define LG(m, e) if (!(e)) Lh(m, "LG("#e")", __FILE__, __LINE__)
#               define D(e) e
#       else   //#if defined(YISC_ENABLE_TEST_MACROS)
#               define I(e)
#               define T(e)
#               define L(m)
#               define LG(m, e)
#               define D(e)
#       endif  //#if defined(YISC_ENABLE_TEST_MACROS)
#endif//__I_hpp____YAZY__
